#ifndef _CAMERA_HPP_
#define _CAMERA_HPP_

#include <string>
#include <vector>
#include <cmath>


#include <IL/il.h>

#include "definitions.hpp"
#include "config.hpp"
#include "misc.hpp"

class Camera
{
private:
    ILuint          _image_id;                  
    float          *_bitmap;
public:
    Vector          position;
    Vector          direction;
    Vector          normal;
    
    int             width_px;
    int             height_px;
    
    real_t         width;
    real_t         height;

    
    real_t         angle;
    real_t         sin_angle;
    //////////////////////
    Vector PixelTo3d( int i, int j);
    Vector GetRandomDirection();
    Vector GetDirection( int i, int j);

    void   SetPixel    ( int i, int j, Color &color);
    void   SetAverPixel( int i, int j, Color &color);
    void   SaveImage ();
    void   SaveImage ( std::string file_name);
    //////////////////////
    Camera ();
    ~Camera();
};

#endif  //_CAMERA_HPP_